import React ,{Component} from "react"
import {View,Text,Animated} from "react-native"
import {connect} from "react-redux";
import QRCode from 'react-native-qrcode-svg'
import ModalDropdown from 'react-native-modal-dropdown';
import Select from "../../components/Select";
import LoadMoreDemo from "../../components/LoadMoreDemo";
import HomeView from "../../components/HomeView";
import HomePage3 from "../../components/HomePage3";
class FadeInView extends Component {
    constructor(props) {
        super(props);
        this.state = {
            fadeAnim: new Animated.Value(0),          // 透明度初始值设为0
        };
    }
    componentDidMount() {
        Animated.timing(                            // 随时间变化而执行的动画类型
            this.state.fadeAnim,                      // 动画中的变量值
            {
                toValue: 1,                             // 透明度最终变为1，即完全不透明
                duration: 5000,
            }
        ).start();                                  // 开始执行动画
    }
    render() {


        return (
            <Animated.View                            // 可动画化的视图组件
                style={{
                    ...this.props.style,
                    opacity: this.state.fadeAnim,          // 将透明度指定为动画变量值
                }}
            >
                {this.props.children}
            </Animated.View>
        );
    }
}

class Test extends Component{
    constructor(props) {
        super(props);
        this.state = {
        };

    }


    render(): React.ReactNode {

        return <HomePage3/>
        return <HomeView/>
        return <LoadMoreDemo/>
        return <View >
            <Text style={{fontSize:48}}>测试页面</Text>
            <FadeInView style={{width: 250, height: 50, backgroundColor: 'powderblue'}}>
                <Text style={{fontSize: 28, textAlign: 'center', margin: 10}}>Fading in</Text>
            </FadeInView>


            <ModalDropdown
                dropdownStyle={{borderWidth:1,borderColor:"#999"}}
                renderRow={(data)=>{return <View><Text>{data}</Text></View>}}
                style={{width:80,backgroundColor:"#999"}} defaultValue="客服" options={['投诉', '建议']}/>
        </View>;
    }

}

export default connect(
    (state) => {
        return {
        }
    },
    (dispatch) => ({

    })
)(Test)